cmake_minimum_required(VERSION 3.1.0)

project(sch)

set(CMAKE_BUILD_TYPE "Release")
set(INCLUDE_PATH ${PROJECT_SOURCE_DIR}/include)
set(JSON_PATH ${INCLUDE_PATH}/json)
set(SCH_PATH ${INCLUDE_PATH}/sch)

include_directories(
		${PROJECT_SOURCE_DIR}/include
		${PROJECT_SOURCE_DIR}/
)

aux_source_directory(${PROJECT_SOURCE_DIR} main.cpp)
add_executable(
		# Main
		sch
		main.cpp
		# SCH
		${SCH_PATH}/defines.h
		${SCH_PATH}/function.cpp
		${SCH_PATH}/function.h
		${SCH_PATH}/sch.h
		${SCH_PATH}/scripts.h
		# JSON
		${JSON_PATH}/allocator.h
		${JSON_PATH}/assertions.h
		${JSON_PATH}/config.h
		${JSON_PATH}/forwards.h
		${JSON_PATH}/json.h
		${JSON_PATH}/json_features.h
		${JSON_PATH}/json_reader.cpp
		${JSON_PATH}/json_tool.h
		${JSON_PATH}/json_value.cpp
		${JSON_PATH}/json_valueiterator.inl
		${JSON_PATH}/json_writer.cpp
		${JSON_PATH}/reader.h
		${JSON_PATH}/value.h
		${JSON_PATH}/version.h
		${JSON_PATH}/writer.h

)
install(
	TARGETS
		sch
	RUNTIME
		DESTINATION /usr/bin
		COMPONENT bin
)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/script ${PROJECT_SOURCE_DIR}/config DESTINATION /etc/sch)
target_link_libraries(sch)
